<?php
class Admin_CarteController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
    	
    	$this->view->title = "La carte";
        $this->view->headTitle($this->view->title);
        $this->view->headLink()->prependStylesheet(APPLICATION_URL.'/css/scrollable.css', 'screen');
    
    }
    
public function addijAction()
    {
        $this->_helper->viewRenderer->setNoRender();
		$this->_helper->getHelper('layout')->disableLayout();

        $i = $this->_getParam('i', 0);
        $j = $this->_getParam('j', 0);
        $pointbassin = new Admin_Model_DbTable_Pointbassin();
        $pointbassin->addArbreIJ($i,$j); 
 
        
    }
public function getcoordonneeAction()
    {
		$this->_helper->viewRenderer->setNoRender();
		$this->_helper->getHelper('layout')->disableLayout();

		$imin = $this->_getParam('imin', 0);
        $imax = $this->_getParam('imax', 0);
        $jmin = $this->_getParam('jmin', 0);
        $jmax = $this->_getParam('jmax', 0);
        
        $arbre = new Admin_Model_DbTable_Arbre();
        $resarbre = $arbre->getCoordonneee($imin,$imax,$jmin,$jmax);
        $pointgmv = new Admin_Model_DbTable_Pointgmv();
        $respointgmv = $pointgmv->getCoordonneee($imin,$imax,$jmin,$jmax);
        $pointbassin = new Admin_Model_DbTable_Pointbassin();
        $respointbassin = $pointbassin->getCoordonneee($imin,$imax,$jmin,$jmax);
       // $arbre = new Admin_Model_DbTable_Pointbassin();
       $res = array();
       $i = 0;
    	foreach ($resarbre as $row) {
     		$res[$i] = array();
 			$res[$i] = $row;
 			$i++;

		}
    	foreach ($respointgmv as $row) {
     		$res[$i] = array();
 			$res[$i] = $row;
 			$i++;

		}
    	foreach ($respointbassin as $row) {
     		$res[$i] = array();
 			$res[$i] = $row;
 			$i++;

		}
        $resultat = Zend_Json :: encode($res);
		$this->_response->setBody($resultat);
    	
    }
}